Microservices Communication in .NET Using gRPC by Fiodar Sazanavets

Microservices Communication in .NET Using gRPC by Fiodar Sazanavets

Author:Fiodar Sazanavets
Language: eng
Format: epub
Publisher: Packt Publishing Pvt Ltd
Published: 2022-01-05T00:00:00+00:00


Your first instance of the server-side application is now ready to start accepting requests from the connected clients. We now need to create a second instance.

To do so, create another project inside the GrpcLoadBalancing solution folder via the following command:

dotnet new web -o GrpcServer2

After this, finalize it by following the same process you did to prepare the GrpcServer1 project. Repeat the steps from 2 to 5, but this time, use GrpcServer2 as the project name. Don't forget to make an additional modification to the project if you intend to run it on Macintosh.

Now, you have two identical web application projects in your solution that can run as two instances of the same gRPC service application. They will be absolutely identical in their functionality. The only difference would be their access URLs, which would have been auto-generated by the dotnet new command. Because the project-creation process allocates randomized port numbers to ASP.NET Core projects, it is unlikely that there will be any port clash between these projects and any of your existing applications running on the machine. But if the clash does occur, you can change those endpoints by modifying the URLs listed under the applicationUrl key of the launchSettings.json file that can be found in the Properties folder inside the project folder.

Now, we are ready to create the client application.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.